Basis functions, such as b-splines, p-splines, and Fourier basis functions, are a common tool for modeling non-linear data. There are three parameters that are chosen to fit basis functions: (1) a number of knots/pairs or of Fourier pairs, (2) a location of each knot or of each Fourier pair, and (3) a degree/period of a polynomial or of a sin/cos function period used to fit the data. Iteratively selecting combinations of these parameters requires significant computer resources particularly given that the number of locations that can be evaluated for each knot/Fourier pair can be large.